use AppleScript version "2.4" -- Yosemite (10.10) or lateruse scripting additions-- tell application "System Events" to key code 9 using {option down, shift down, command down}tell application "System Events" to key code 4 using {option down, command down}